
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台注册</title>
	<meta name="renderer" content="webkit">	
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">	
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">	
	<meta name="apple-mobile-web-app-capable" content="yes">	
	<meta name="format-detection" content="telephone=no">	
	<!-- load css -->
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/denglu/common/layui/css/layui.css" media="all">
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/denglu/houtai/css/login.css" media="all">
</head>
<body>
<div class="layui-canvs"></div>
<div class="layui-layout layui-layout-login">
	<h1 style="text-align:center;">
		 <strong>用户注册</strong>
		 <em>
User registration</em>
	</h1>
	<div class="layui-user-icon larry-login">
		 <input type="text" id="username"  placeholder="账号" class="login_txtbx"/>
	</div>
	<div class="layui-pwd-icon larry-login">
		 <input type="password"  id="password" placeholder="密码" class="login_txtbx"/>
	</div>
	<div class="layui-pwd-icon larry-login">
		 <input type="password"  id="repass" placeholder="确认密码" class="login_txtbx"/>
	</div>
	<div class="layui-pwd-icon larry-login">
		 <input type="password"  id="yaoqingma" placeholder="请输入邀请码" class="login_txtbx"/>
	</div>
	<div class="layui-pwd-icon larry-login" >
		 <input type="password"  id="tixianpwd" placeholder="请输入提现密码" class="login_txtbx"/>
	</div>
	
    <div class="layui-val-icon larry-login">
    	<div class="layui-code-box" >
    		<input type="text" id="code"  name="code" placeholder="验证码" maxlength="4" class="login_txtbx">
            <img src='{:U("Login/verify")}' onClick="this.src=this.src+'?'+Math.random()"/>
    	</div>
    </div>
    <div class="layui-submit larry-login">
    	<input type="button" value="立即注册"  onClick="dosubmit()" class="submit_btn"/>
    </div>
    <div class="layui-login-text" style="width:80%;">
    	<p style="text-align:right;"><a href="{:U('Login/login')}">已有账号现在登录</a></p>
    
    </div>
</div>
<script type="text/javascript" src="__PUBLIC__/denglu/common/layui/lay/dest/layui.all.js"></script>
<script type="text/javascript" src="__PUBLIC__/denglu/houtai/js/login.js"></script>
<script type="text/javascript" src="__PUBLIC__/denglu/houtai/jsplug/jparticle.jquery.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
$(function(){
	$(".layui-canvs").jParticle({
		background: "#141414",
		color: "#E6E6E6"
	});
	//登录链接测试，使用时可删除
	
});
</script>
<script>
  
  function dosubmit(){
  
  
    var verify=$('#code').val();
    var username=$('#username').val();
	var password=$('#password').val();
	var tixianpwd=$('#tixianpwd').val();
	var repass=$('#repass').val();
	var yaoqingma=$('#yaoqingma').val();
	
	if(username==""){
	
	  layer.msg('用户名不能为空', {icon: 5});return;
	}
	
	if(password==""){
	
	  layer.msg('密码不能为空', {icon: 5});return;
	
	}
	
	if(password!=repass){
	
	  layer.msg('两次密码输入不一致', {icon: 5});return;
	
	}
	
	if(verify==""){
	
	   layer.msg('验证码不能为空', {icon: 5});return;
	
	}
	
	if(yaoqingma==""){
	
	  layer.msg('邀请码不能为空', {icon: 5});return;
	
	}
	
	
	if(tixianpwd==""){
	
	  layer.msg('提现密码不能为空', {icon: 5});return;
	
	}
	
	$.post("{:U('Login/reg')}",{"username":username,"password":password,'verify':verify,"tixianpwd":tixianpwd,"repass":repass,"yaoqingma":yaoqingma},function(re){
	  
	  if(re==1){
	    layer.alert('恭喜您注册成功', {icon: 6},function(){
		
		  location.href="{:U('Index/index')}";
		
		});
		
	  }else if(re==2){
	  
	      layer.msg('注册失败', {icon: 5});return;
	  
	  }else if(re==4){
	  
	      layer.msg('验证码错误', {icon: 5});return;
	  
	  }else if(re==6){
	  
	      layer.msg('提现密码或者注册密码不能为空', {icon: 5});return;
	  
	  }else if(re==7){
	  
	      layer.msg('用户名不能为空', {icon: 5});return;
	  
	  }else if(re==5){
	  
	      layer.msg('两次密码输入不一样', {icon: 5});return;
	  
	  }else if(re==8){
	  
	      layer.msg('邀请码不存在', {icon: 5});return;
	  
	  }else if(re==3){
	  
	      layer.msg('该用户名已经存在', {icon: 5});return;
	  
	  }
	
	
	})
  
  
 
  
  }

</script>


</body>
</html>